package com.yunchang.springboot.mapper.mwsfinance;

import com.yunchang.springboot.models.mwsfinance.FReimbursement;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface FReimbursementMapper {
    int deleteByPrimaryKey(Long id);

    int insert(FReimbursement record);

    int insertSelective(FReimbursement record);

    FReimbursement selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(FReimbursement record);

    int updateByPrimaryKey(FReimbursement record);

    Integer selectSumQuantityReimbursedInventoryBySellerIdAndSkuAndAdjustedDate(String sellerId,String sku,String adjustedDate);

    /**
     * 根据createTime和type集合获取对应的数据
     * @param time
     * @param typeList
     * @return
     */
    List<FReimbursement> selectByCreateTimeAndTypeList(@Param("time") String time,@Param("typeList") List<String> typeList);

    /**
     * 根据参数获取type
     * @param sellerId
     * @param reimbursementId
     * @param sku
     * @return
     */
    String selectTypeBySellerIdAndOriginalReimbursementIdAndSku(String sellerId,String reimbursementId,String sku);

    /**
     * 根据type集合和是否生成下推数据以及reason不为该值的数据
     * @param typeList
     * @param isPushStatus
     * @param reason
     * @return
     */
    List<FReimbursement> selectByTypeListAndIsPushStatusAndNotReason(@Param("typeList") List<String> typeList,@Param("isPushStatus")Integer isPushStatus,@Param("reason")String reason);

    /**
     * 根据fReimbursementList对象集合更新isPushStatus的值
     * @param fReimbursementList
     * @return
     */
    int updateIsPushStatusByFReimbursementList(@Param("fReimbursementList") List<FReimbursement> fReimbursementList);
}